Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

327
Visualizações
TypeError: Suite argument "title" must be a string. Received type "undefined"

I am trying to save data to MongoDB, But this error is occurring.

I am trying to export the describe function to save data on MongoDB onclick on Complete button. Also, why is it var app is not showing on my page when I include const demo = require on my index.js. I think I need it to import the describe function. I don't know what's wrong, please send help.

This is my index.js

const demo = require("./demo_test")

Survey
    .StylesManager
    .applyTheme("defaultV2");

const json = {
    pages: [
      {
        questions: [
          {
            type: "radiogroup",
            name: "Question 1",
            title: "Deliver through others.",
            choices: [
              "Not effective",
              "Neither effective nor Effective",
              "Effective"
            ]
          },
          {
            type: "radiogroup",
            name: "Question 2",
            title: "Understand others perspective.",
            choices: [
              "Not effective",
              "Neither effective nor Effective",
              "Effective"
            ]
          },
          {
            type: "radiogroup",
            name: "Question 3",
            title: "Solve complex problems.",
            choices: [
              "Not effective", 
              "Neither effective nor Effective",
              "Effective"
            ]
          },
        ]
      }
    ]
  };

window.survey = new Survey.Model(json);

survey
    .onComplete
    .add(function (sender) {
        let data = JSON.stringify(sender.data)
        data = data.replaceAll("Not effective", "A")
        data = data.replaceAll("Neither effective nor Effective", "B")
        data = data.replaceAll("Effective", "C")
    var obj = JSON.parse(data)

    document
        .querySelector('#surveyResult')
        .textContent = "Result JSON:\n" + JSON.stringify(obj, null, 3);
        
    describe(obj)

});

var app = new Vue({
    el: '#surveyElement',
    data: {
        survey: survey
    }
});

this is my demo_test.js

const mocha = require('mocha')
const { assert } = require('assert');
const Question = require('../models/questions');


describe('Saving records', function(obj){

it('Saves a record to the database', function(done){
    var char = new Question({
        obj
    });

    char.save().then(function(){
        assert(char.isNew === false);
        done();
    });
});
});

    module.exports = describe();
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda